package com.robusta.app.model.spreadsheet.loader;

import com.robusta.spreadsheet.describe.WorkbookInfo;
import com.robusta.spreadsheet.model.Workbook;
import com.robusta.spreadsheet.model.WorkbookFactory;
import com.robusta.spreadsheet.model.exception.WorkbookException;

import java.io.InputStream;

public class WorkbookLoader {
    private WorkbookTemplate workbookTemplate;
    public WorkbookLoader(WorkbookInfo workbookInfo) {
        this.workbookTemplate = new WorkbookTemplate(workbookInfo);
    }

    public Workbook load(InputStream inputStream) throws WorkbookException {
        return WorkbookFactory.create(inputStream, workbookTemplate);
    }
}
